<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="外协付款一览表" />
<%@ include file="../inc/PrintTitle.jsp"%>
<head>
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doCancel(){
		window.close();
	}
	function doPrint(){
		ShowConfirm('确认框','确定开始打印吗？',340,80,"doPrintCallBack()");
	}
	function doPrintCallBack(){
		if(popRetVal!=null){
			var len=${fn:length(imprestList)+fn:length(payList)};
			var isIE = (navigator.userAgent.indexOf('MSIE')>=0) || (navigator.userAgent.indexOf('Trident')>=0);
			document.getElementById("noPrinSpan").style.display="none";
			if(len>200 && isIE){
				iePrint("wb","${enterpriseInfo.doPrint}");
			}else{
				printContent("管理易-外协付款一览表","${enterpriseInfo.doPrint}","${enterpriseInfo.printWidth}");
			}
			document.getElementById("noPrinSpan").style.display="";
		}
	}
</script>
</head>
<body style="background-color:#FFFFFF">
<OBJECT classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2" height=0 id=wb name=wb width=0></OBJECT>
<table width="100%" border="0"  align="center" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td height="40px" align="center" class="FontLarge_Bold">${licenseInfo.enterpriseName} 外协付款一览表</td>
				</tr>
		  </table>
		</td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="ListTable">
				<tr class="ListTrPrint">
			      	<td class="FontSmall" >付款合计：${total}元</td>
				</tr>
			</table>
		</td>
	</tr>
	<c:if test="${fn:length(imprestList)>0}">
	<tr>
		<td height="3"></td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="small_border">
				<tr class="ListTrPrint">
					<td class="FontSmall_Bold" align="center" width="10%">预付日期</td>
					<td class="FontSmall_Bold" align="center" width="14%">单号</td>
					<td class="FontSmall_Bold" align="center" width="18%">外协商</td>
					<td class="FontSmall_Bold" align="center" width="18%">摘要</td>
					<td class="FontSmall_Bold" align="center" width="14%">银行账户</td>	
					<td class="FontSmall_Bold" align="center" width="10%">金额</td>						
					<td class="FontSmall_Bold" align="center" width="8%">经办人</td>	
					<td class="FontSmall_Bold" align="center" width="8%">开单人</td>	
				</tr>
				<c:forEach var="item" items="${imprestList}" varStatus="i">
				<tr class="ListTrPrint">
					<td class="FontSmall" align="center"><fmt:formatDate value="${item[0].cooperBill.cooperDate}" pattern="yyyy-MM-dd"/></td>
					<td class="FontSmall" align="center">${item[0].cooperBill.billCode}</td>
					<td class="FontSmall" align="center">${item[1]}</td>
					<td class="FontSmall" align="right">${item[0].cooperBill.content}</td>
					<td class="FontSmall" align="center"><commonTag:showSimpleObjectName list="${bankAccountList}" objectId="${item[0].cooperBill.bankAccountId}" /></td>
					<td class="FontSmall" align="right">${item[0].cooperBill.imprest}</td>
					<td class="FontSmall" align="center">${item[0].cooperBill.managerName}</td>
					<td class="FontSmall" align="center">${item[0].cooperBill.createrName}</td>
				</tr>
				</c:forEach>
		  </table>
		</td>
	</tr>
	</c:if>
	<c:if test="${fn:length(payList)>0}">
	<tr>
		<td height="5"></td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="small_border">
				<tr class="ListTrPrint">
					<td class="FontSmall_Bold" align="center" width="10%">付款日期</td>
					<td class="FontSmall_Bold" align="center" width="14%">单号</td>
					<td class="FontSmall_Bold" align="center" width="18%">外协商</td>
					<td class="FontSmall_Bold" align="center" width="18%">摘要</td>
					<td class="FontSmall_Bold" align="center" width="14%">银行账户</td>
					<td class="FontSmall_Bold" align="center" width="10%">金额</td>
					<td class="FontSmall_Bold" align="center" width="8%">经办人</td>
					<td class="FontSmall_Bold" align="center" width="8%">开单人</td>	
				</tr>
				<c:forEach var="item" items="${payList}" varStatus="i">
				<tr class="ListTrPrint">
					<td class="FontSmall" align="center"><fmt:formatDate value="${item[0].payBill.payDate}" pattern="yyyy-MM-dd"/></td>
					<td class="FontSmall" align="center">${item[0].payBill.billCode}</td>
					<td class="FontSmall" align="center">${item[1]}</td>
					<td class="FontSmall" align="right">${item[0].payBill.cost}</td>
					<td class="FontSmall" align="center"><commonTag:showSimpleObjectName list="${bankAccountList}" objectId="${item[0].payBill.bankAccountId}" /></td>
					<td class="FontSmall" align="right">${item[0].payBill.description}</td>
					<td class="FontSmall" align="center">${item[0].payBill.managerName}</td>
					<td class="FontSmall" align="center">${item[0].payBill.createrName}</td>
				</tr>
				</c:forEach>
		  </table>
		</td>
	</tr>
	</c:if>
	<tr>
		<td height="3"></td>
	</tr>
	<tr id="noPrinSpan">
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td>
						<input type="button" id="printButton" class="Button" value="开始打印 " onClick="doPrint();">
						<input type="button" id="cancelButton" class="Button" value=" 退 出 " onClick="doCancel();">
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>